package com.csun.comp380.rng;

import java.util.Random;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;

public class MainActivity extends Activity {

	public final static String EXTRA_MESSAGE = "com.csun.comp380.rng.MESSAGE";
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    public void runRNG(View view) {
    	Intent intent = new Intent(this, DisplayRandom.class);
//    	Intent intent = new Intent(this, DisplayMessageActivity.class);
    	Random random = new Random();
    	int rand = random.nextInt(100) + 1;
    	String message = "" + rand;
    	intent.putExtra(EXTRA_MESSAGE, message);
    	startActivity(intent);
    }
}
